package com.lwj.mallchat.common.common.domain.enums;

/**
 * @author lwj
 * @ClassName CommonErrorEnum
 * @date 2024/10/20 16:28
 */

import com.lwj.mallchat.common.common.exception.ErrorEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum CommonErrorEnum  implements ErrorEnum {

    BUSINESS_ERROR(0, "{0}"),
    SYSTEM_ERROR(-1, "系统出小差了，请稍后再试哦~~"),
    PARAM_INVALID(-2, "参数校验失败"),
    LOCK_LIMIT(-3, "请求太过频繁，请稍后再试")  //分布式锁异常

    ;
    private final Integer code;
    private final String msg;

    @Override
    public Integer getErrorCode() {
        return code;
    }

    @Override
    public String getErrorMsg() {
        return msg;
    }
}
